﻿<Window x:Class="TeamProjectManager.Modules.WorkItemConfiguration.WorkItemQueryEditorDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:TeamProjectManager.Common.Infrastructure;assembly=TeamProjectManager.Common"
        xmlns:c="clr-namespace:TeamProjectManager.Common.Converters;assembly=TeamProjectManager.Common"
        xmlns:w="clr-namespace:TeamProjectManager.Modules.WorkItemConfiguration"
        Title="Edit Work Item Queries"
        WindowStartupLocation="CenterOwner"
        ShowInTaskbar="False"
        Height="600"
        Width="800">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <ComboBox Grid.Row="0" x:Name="selectedItemComboBox" ItemsSource="{Binding}" SelectedIndex="0">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock>
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0}/{1} ({2})">
                                    <Binding Path="Path" />
                                    <Binding Path="Name" />
                                    <Binding Path="TeamProject" />
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>

            <TextBox Grid.Row="1" Text="{Binding ElementName=selectedItemComboBox, Path=SelectedItem.Text}" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0,5,0,0" i:FindProvider.FindEnabled="true" />

        </Grid>

        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,0">
            <Button Content="OK" IsDefault="True" Width="75" x:Name="okButton" Click="okButton_Click" />
            <Button Content="Cancel" IsCancel="True" Width="75" Margin="5,0,0,0" />
        </StackPanel>
    </Grid>
</Window>